﻿namespace BlackBox
{
    public class DecisionEngine
    {
        public decimal ThresholdPercentage { get; private set; }
        
        public DecisionEngine(decimal thresholdPercentage)
        {
            ThresholdPercentage = thresholdPercentage;
        }


        public MarketAction MakeDecision( AnalysisData analysisData, MinuteInterval interval )
        {
            if (analysisData.ProjectedChangePercentage[interval] >= ThresholdPercentage)
            {
                return MarketAction.Buy;
            }
            
            if (analysisData.ProjectedChangePercentage[interval] <= (-ThresholdPercentage))
            {
                return MarketAction.Short;
            }

            return MarketAction.None;
        }
    }
}
